import service from "./index";


// 登录接口
export function login(data:any){
    return service({
        url:'/admin_login',
        method:'post',
        data
    })
}
export function register(data:any){
    return service({
        url:'/admin_register',
        method:'post',
        data
    })
}
// 商品列表接口
export function getGoodsList(data:any) {
    return service({
        url:'/shoplist',
        method:'post',
        data:data
    })
}

// 用户列表接口
export function UserList(data:any) {
    return service({
        url:'/userList',
        method:'post',
        data
    })
}

// 所有订单
export function allOrder(data:any) {
    return service({
        url:'/allOrder',
        method:'post',
        data:data
    })
}

// 获取token
export function getToken() {
    return service({
        url:'/getToken',
        method:'get'
    })
}
// 商品上传
export function uploadShop(data:any) {
    return service({
        url:'/uploadShop',
        method:'post',
        data:data
    })
}
// 商品编辑
export function editShop(data:any) {
    return service({
        url:'/editShop',
        method:'post',
        data:data
    })
}
// 商品删除
export function shopDelete(id:any) {
    return service({
        url:`/shopDelete?shop_id=${id}`,
        method:'get'
    })
}

// 退款
export function orderRefund(id:any) {
    return service({
        url:`/orderRefund?order_id=${id}`,
        method:'get'
    })
}

// 获取日志表
export function logInfo(data:any) {
    return service({
        url:'/log',
        method:'post',
        data
    })
}
// 获取订单分析数据
export function orderData() {
    return service({
        url:'/orderData',
        method:'get'
    })
}
// 每日订单分析
export function dayOrder() {
    return service({
        url:'/dayOrder',
        method:'get'
    })
}
// 更新用户
export function userUpdate(data:any) {
    return service({
        url:'/userUpdate',
        method:'post',
        data
    })
}
// 删除用户
export function userDelete(id:any) {
    return service({
        url:`/userDelete?id=${id}`,
        method:'get'
    })
}
// 搜锁商品
export function searcchGoods(data:any) {
    return service({
        url:`/searchGoods`,
        method:'post',
        data
    })
}